<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt"  uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <!--公共样式-->
    <link href="${pageContext.request.contextPath }/web/css/font/iconfont.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/web/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/NormalizeFile.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/public.css" />
    <!--列表页面私有样式-->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/web/css/subpage/person.css" />
</head>
<body class="w928">
    <!--用户中心 begin-->
        <!--我的订单-->
        <div class="right-content bor1 font1">
            <div class="bor1-t xx-top">
             <spring:message code="dingdanmingxi"></spring:message>
            </div>
            <div class="bor1-t order-detail-content">
               <p>
                 <spring:message code="dingdanzhuangtai"></spring:message>：
       <c:choose>
			<c:when test="${orders.oState==0}">
		     <spring:message code="daifukuan"></spring:message><a href="javascript:pay();"> <spring:message code="qufukuan"></spring:message>>></a><br/>
			</c:when>
			<c:when test="${orders.oState==1}">
			 <spring:message code="yifukuan"></spring:message><br/>
			</c:when>
			<c:when test="${orders.oState==2}">
			 <spring:message code="yishouhuo"></spring:message><br/>
			</c:when>
		</c:choose>              
                   
                   
               
        <spring:message code="shouhuodizhi"></spring:message>：${orders.oName} &nbsp; &nbsp;${orders.oPhone} &nbsp; &nbsp;${orders.oAddress} &nbsp; &nbsp;${orders.oAddressInfo }<br/>
        <spring:message code="fapiaoxinxi"></spring:message>：<c:if test="${orders.oInvoiceState==0}"><spring:message code="wu"></spring:message> <br/></c:if>
             <c:if test="${orders.oInvoiceState==1}">${orders.oPatternNo} <br/></c:if>      
         <spring:message code="dingdanbianhao"></spring:message>：${orders.oNo}<br/>
         <spring:message code="xiadanshijian"></spring:message>：<fmt:formatDate value="${orders.oCreatTime}" pattern="yyyy-MM-dd HH:mm:ss"/>  
               </p>
                <div class="order-wei">
                    <div class="order-top bor1 bor-t0 h50 line-h50 detail-or-top">
                        <span class="w35"> <spring:message code="dingdanxinxi"></spring:message></span>
                        <span class="w33"> <spring:message code="dingdanmishu"></spring:message></span>
                        <span class="w33"> <spring:message code="dingdanjine"></spring:message></span>
                    </div>
                    <div class="order-content-wei">
                        <div class="or-detail">
                            <ul>
                            <c:forEach items="${orderslist}" var="item">
                                <li>
                                    <div class="w35">
                                        <div class="or8">
                                         <c:choose>
										<c:when test="${item.OL_TYPE!=3}">
						                <img src="${imgpath }${item.OL_PATTERN_IMG}" />
						                </c:when>
						                <c:when test="${item.OL_TYPE==3}">
						                <img src="${pageContext.request.contextPath }/upload/${item.MESSAGE3}" />
						             </c:when>
						             <c:otherwise>
						               <img src="${pageContext.request.contextPath }/web/img/bl2.jpg" />
						             </c:otherwise>
						             </c:choose>
                                     
                                        </div>
                                        <div class="or7">
                                             <c:choose>
											<c:when test="${item.OL_TYPE==0}">
											 <p class="zichang" style="line-height:48px;"><spring:message code="huaxing"></spring:message>：<span title="${item.OL_PATTERN_NO}"> ${item.OL_PATTERN_NO}</span> <br/>
		                                       <span title="${item.PP_NAME}">${item.PP_NAME}</span>
											</c:when>
											<c:when test="${item.OL_TYPE==1}">
											 <p class="zichang" style="line-height:100px;"><spring:message code="huaxing"></spring:message>：<span title="${item.OL_PATTERN_NO}">${item.OL_PATTERN_NO}</span>
		                                            
											</c:when>
											<c:when test="${item.OL_TYPE==2}">
											 <p class="zichang" style="line-height:35px;"><spring:message code="huaxing"></spring:message>：<span title="${item.OL_PATTERN_NO}">${item.OL_PATTERN_NO}</span>
		                                            <br/>
		                                               	 <spring:message code="mianliao"></spring:message>：<span title="${item.OL_FABRIC_NO}">${item.OL_FABRIC_NO}</span> <br/>
		                                               	  <span title="${item.PP_NAME}">${item.PP_NAME}</span>
											</c:when>
											<c:when test="${item.OL_TYPE==3}">
											 <p class="zichang" style="line-height:100px;">
		                                               	<spring:message code="mianliao"></spring:message>：<span title="${item.OL_FABRIC_NO}">${item.OL_FABRIC_NO}</span>
											</c:when>
											</c:choose> 
                                            </p>
                                        </div>
                                    </div>
                                    <div class="w33">
                                         ${item.OL_FABRIC_SIZE} <spring:message code="mi"></spring:message>
                                    </div>
                                    <div class="w33">
                                    
                                        ￥<fmt:formatNumber pattern="0.00" value="${item.MESSAGE2 + 0.0001}"/>
                                    </div>
                                </li>
                                </c:forEach>
                            </ul>
                        </div>
                    </div>
                </div>

                <p class="real-pay">
                   <spring:message code="shifukuan"></spring:message>：<span>￥${orders.oTotalPrice}</span>
                </p>


            </div>
        </div>
        <form id="pay" target="_blank" action="${pageContext.request.contextPath}/web/orders/pay" method="post">
        <input type="hidden" value="${orders.oId}" name="oId" id="oId">
        </form>
    <!--用户中心 end-->
    <!--全局-->
    <script type="text/javascript" src="${pageContext.request.contextPath }/web/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/web/js/public.js"></script>
       <script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/layer/2.1/layer.js"></script>
    <!--ie789下placeholder不兼容-->
    <script type="text/javascript" src="${pageContext.request.contextPath }/web/js/placeholder.js"></script>
    <!--头部的以图搜图-->
    <%-- <script type="text/javascript" src="${pageContext.request.contextPath }/web/js/uppicFile.js"></script> --%>
    <script>
        $(function () {
            $(".or-right").each(function(){
                $(this).css({
                    "margin-top": $(this).parent(".order-content-wei").height() / 2 - 60
                })
            });


        });
        function pay(){
        	
        	$.ajax({
      			 url:'${pageContext.request.contextPath }/web/orders/chakandingdan',
      			 async : false,
      			 data: {"oId":$("#oId").val()},
      			 type : "GET", 
      			 success :function(result){
      			 if(result == "SUCCESS"){
      				$("#pay").submit();
      			 }else{//失败
      				parent.layer.msg("<spring:message code='huaxingyibeimaiduan'></spring:message>", {icon: 0,time: 1000}); 
      			 }
      			 }
      			 });
        }
    </script>
</body>
</html>